package com.zjmzxfzhl.integrityconstraint.service;

import com.zjmzxfzhl.integrityconstraint.entity.IntegrityConstraint;
import com.zjmzxfzhl.integrityconstraint.pojo.ToCheck;

import java.util.List;

/**
 * 业务完整性验证接口类
 *
 * @author 庄金明
 */
public interface IntegrityConstraintService {

    /**
     * 保存每个步骤缓存信息
     *
     * @param integrityConstraint
     * @return
     */
    Boolean save(IntegrityConstraint integrityConstraint);

    /**
     * 业务提交前的完整性验证方法
     *
     * @param businessKey
     * @param toChecks
     * @return
     */
    Boolean check(String businessKey, List<ToCheck> toChecks);

    /**
     * 业务完整性验证通过后，应删除缓存信息
     *
     * @param businessKey
     * @return
     * @throws Throwable
     */
    Boolean delete(String businessKey);
}
